package com.neutech.view;

import java.util.Scanner;

public class businessView {
    static Scanner scanner = new Scanner(System.in);
    public static void businessmenu(){
        int x = 0;
        System.out.println("欢迎使用饿了么商家管理系统");
        System.out.println("1.登录");
        System.out.println("2.注册");
        System.out.println("3.返回");
        int L = scanner.nextInt();
        if(L == 1){
            x = businessLogon.businessOn();
            if(x == 0){
                System.out.println("没有此用户");
                businessView.businessmenu();
            }else {
                System.out.println(x);
                businessView.businessManageMenu();
            }
        } else if (L == 2) {
           x = businessLogon.register();
           if(x == 0){
               System.out.println("注册失败");
               businessView.businessmenu();
           }else {
               System.out.println("注册成功");
               businessView.businessmenu();
           }
        } else if (L == 3) {
            totalView.totalmenu();
        }
    }

    public static void businessManageMenu(){
        System.out.println("1.查看商家信息");
        System.out.println("2.修改商家信息");
        System.out.println("3.修改密码");
        System.out.println("4.进入食品管理");
        System.out.println("5.返回");
        int x = scanner.nextInt();
        if(x == 1){
            adminLogon.adminInquiryBusiness();
            System.out.println("查询完成");
            businessManageMenu();
        } else if (x == 2) {
            adminLogon.adminUpdateBusiness();
            System.out.println("修改完成");
            businessManageMenu();
        } else if (x == 3) {
            businessLogon.updatePassword();
            System.out.println("修改完成");
            businessManageMenu();
        } else if (x == 4) {
            foodView.foodmenu();
        } else if (x == 5) {
            businessmenu();
        }
    }
}
